package com.imooc.example.springtxjms.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author linzou@linkdoc.com
 * @ClassName: CustomerResource
 * @Description:
 * @date 2019/1/1 4:16 PM
 */
@RestController
@RequestMapping("/api/customer")
public class CustomerResource {

    @Autowired
    private JmsTemplate jmsTemplate;


    @PostMapping("/message1/listen")
    public void create(String msg){
        jmsTemplate.convertAndSend("customer:msg:new",msg);
    }


}
